<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Campaigns Management'); ?></div>
    <h2>Campaigns</h2>
    <p>A campaign is set of related advertisements that an advertiser wants to display. Campaigns allow shared common properties, such as the dates to start and stop showing the ads, and the frequency with the ads are displayed, to be managed in a consistent way across the related ads. Each campaign that an advertiser has will have one or more banners.</p>
    
    <div class="entry">
        <div class="sep"></div>
    </div>
    <table>
        <thead>
            <tr>
                <th scope="col" class="chb"><input type="checkbox" onclick="selectAll(this);"></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Name');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Period');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Type');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Description');?></th>
                <th scope="col"><?php  echo Yii::t('AdmincpModule.admincp', 'Status');?></th>
            </tr>
        </thead>
        <tbody>
        <?php if(!empty($arrCampaigns)):?>
            <?php foreach($arrCampaigns as $i=>$R):?>
            <tr>
                <td class="align-center"><input type="checkbox"></td>
                <td>
                    <strong><a href="javascript:void(0);" style="text-decoration:none;"><?php echo $R['campaign_name']; ?></a></strong>
                    <p style="margin:0; padding: 2px 0 0;">
                        <a href="<?php echo LINK_ADMINCP_ADVERTISEMENTS.'/banners/?campaign='.$R['campaign_id']; ?>"  title="Items">Banners</a> | 
                        <a href="<?php echo LINK_ADMINCP_ADVERTISEMENTS.'/updateCampaign/?id='.$R['campaign_id']; ?>"  title="Edit">Edit</a> | 
                        <a href="<?php echo LINK_ADMINCP_ADVERTISEMENTS.'/deleteCampaign/?id='.$R['campaign_id']; ?>" title="Delete">Delete</a> 
                    </p>
                </td>
                <td>Published: <?php echo $R['campaign_published_date'];?><br>Expired: <?php echo $R['campaign_expiry_date'];?> </td>
                <td><?php echo $R['campaign_type'];?></td>
                <td>Desc: <?php echo $R['campaign_description']; ?></td>
                <td><?php //echo $R['campaign_status']; ?></td>
            </tr>
            <?php endforeach; ?>
        <?php else: ?>
            <tr>
                <td colspan="7">No data found!</td>
            </tr>
        <?php endif; ?>
        </tbody>
    </table>
    <div class="entry">
        <?php $this->widget('Pagination', array(
            'pages' => $objPages,
        )) ?>
        <div class="sep"></div>		
        <a class="button add" href="<?php echo LINK_ADMINCP_ADVERTISEMENTS.'/updateCampaign/?client='.$intClient; ?>"><?php echo Yii::t('AdmincpModule.admincp', 'Add Campaign'); ?></a> 
    </div>
</div>